<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>新经资讯后台管理</title>
	<link rel="stylesheet" type="text/css" href="../static/admin/css/reset.css">
	<link rel="stylesheet" type="text/css" href="../static/admin/css/main.css">
	<script type="text/javascript" src="../static/admin/js/jquery-1.12.4.min.js"></script>
</head>
<body>

	<div class="header">
		<a href="" class="logo fl"><img src="../static/admin/images/logo.png" alt="logo"></a>
		<a href="/login" onclick="logout()" class="logout fr">退 出</a>
	</div>
	<div class="side_bar">

		<div class="user_info">
            {{ get_flashed_messages()[0] }}
                <img src="../static/admin/images/02.gif" alt="哎呀，出错了">
			<p>管理员 <em><i style="font-size: 18px">{{ username }}</i></em></p>
		</div>

		<div class="menu_con">
			<div class="first_menu"><a href="#" class="icon02">分类管理</a></div>

			<ul class="sub_menu">
                <li><a href="/pagelist" class="icon034" target="main_frame">分类列表</a></li>
				<li><a href="/add_cate" class="icon034" target="main_frame">添加分类</a></li>
			</ul>

			<div class="first_menu"><a href="#" class="icon02">图书管理</a></div>

			<ul class="sub_menu">
                <li><a href="/goodslist" class="icon034" target="main_frame">图书列表</a></li>
				<li><a href="/add_goods" class="icon034" target="main_frame">添加图书</a></li>
			</ul>

		</div>
	</div>

	<div class="main_body" id="main_body">
		<iframe src="../static/admin/images/333.png" frameborder="1" id="main_frame" name="main_frame" frameborder="1" scrolling="auto"></iframe>
{#		<img src="../static/admin/images/12.png" id="main_frame" name="main_frame" frameborder="1" scrolling="auto">#}
	</div>

	<script>
		//退出
		function logout(){
			$.ajax({
				url:'/admin/logout',//服务器地址
				type:'post',//请求类型
				dataType:'json',
				success:function(res){
					if(res.code == 200){
						//成功操作
						window.location.href="/admin/rend_login"
					}else{
						alert(res.message)
					}
				}
			})

		}
		$(function(){
			$('.first_menu').click(function(){
				$(this).addClass('active').siblings('.first_menu').removeClass('active');
				$(this).next().slideDown().siblings('.sub_menu').slideUp();
			})
			var frame_w = $('#main_body').outerWidth();
			var frame_h = $('#main_body').outerHeight();
			$('#main_frame').css({'width':frame_w,'height':frame_h});
		})


	</script>

</body>
</html>